package pers.jphoebe.quartz.exception;


import pers.jphoebe.quartz.entity.response.ErrorCode;
import pers.jphoebe.quartz.entity.response.ResponseData;
import pers.jphoebe.quartz.utils.ResponseDataUtils;

/**
 * Created by 蒋时华 on 2017/8/1.
 */
public class CustomException extends RuntimeException {

    private ResponseData responseData;
    private ErrorCode errorCode;

    public CustomException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.errorCode = errorCode;
        responseData = ResponseDataUtils.error(errorCode);
    }
    
    public ErrorCode getErrorCode() {
		return errorCode;
	}



	public void setErrorCode(ErrorCode errorCode) {
		this.errorCode = errorCode;
	}



	public ResponseData getResponseData() {
        return responseData;
    }

    public void setResponseData(ResponseData responseData) {
        this.responseData = responseData;
    }
}
